<?php

namespace app\app\model;

use think\Model;

class RandModel extends Model
{
    public static function randId()
    {
        $permitted_chars = '0123456789abcdefghijklmnopqrstuvwxyz';
        $time = time();
        $new = str_shuffle($time . substr(str_shuffle($permitted_chars), 0, 22));
        $id = substr($new, 0, 8) . '-' . substr($new, 8, 4) . '-' . substr($new, 12, 4)
            . '-' . substr($new, 16, 4) . '-' . substr($new, -12);
        return $id;
    }
}